#root {
    height: 100%;
}

#root {
    display: flex;
    flex-direction: column;
}

body {
    --font-size: 13px;
    background: var(--box-background);
    color: var(--box-color);
    margin: initial;
    font: message-box;
    font-size: var(--font-size);
    overflow: hidden;
}

[hidden] {
    display: none !important;
}

.banner {
    align-items: center;
    background-color: var(--blue-50-a30);
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
    display: flex;
    font-size: 0.9em;
    gap: 0.5em;
    padding: 0.5em 0.75em;
}
.banner > button {
    --button-background: hsla(0, 0%, 50%, 0.3);
    --button-background-hover: hsla(0, 0%, 30%, 0.3);
    --button-background-active: hsla(0, 0%, 10%, 0.3);
    margin-left: auto;
}

.banner--warn {
    background-color: var(--red-60-a30);
}

.banner::before {
    content: "";
    height: 16px;
    width: 16px;
}
.banner--info::before {
    background-image: url("../../assets/photon_info.svg");
}
.banner--warn::before {
    background-image: url("../../assets/photon_warning.svg");
}

@media (prefers-color-scheme: dark) {
    .banner {
        border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    }
    .banner > button {
        --button-background: hsla(0, 0%, 50%, 0.3);
        --button-background-hover: hsla(0, 0%, 70%, 0.3);
        --button-background-active: hsla(0, 0%, 90%, 0.3);
    }
}

.media-type-select {
    align-items: baseline;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    margin: 0 1em;
    padding: 0.75em 0;
}

.media-type-select__label-cast,
.media-type-select__label-to {
    display: inline-block;
}
.media-type-select__label-cast:not(:empty) {
    margin-inline-end: 0.5em;
}
.media-type-select__label-to:not(:empty) {
    margin-inline-start: 0.5em;
}

.search {
    display: flex;
    padding: 1em;
    position: relative;
    margin-top: -1px;
}
.search-input {
    width: 100%;
}
.search-clear {
    background-color: transparent !important;
    background-image: url("../../assets/photon_cancel.svg");
    background-size: 50%;
    margin-right: 1em;
    opacity: 0.5;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}
.search-clear:hover {
    opacity: 1;
}

.receiver-list {
    list-style: none;
    margin: initial;
    height: auto;
    max-height: 500px;
    overflow-y: auto;
    padding: 0 1em;
    padding-bottom: 0.25em;
}

.receiver-list__not-found {
    align-items: center;
    color: var(--secondary-color);
    display: flex;
    height: 50px;
    justify-content: center;
    padding: 0.75em 1em;
}

.receiver {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 50px;
    padding: 0.75em 0;
    position: relative;
}
.receiver--result .receiver__name > b {
    font-weight: 600;
}
.receiver:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.receiver__details {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.receiver__name,
.receiver__status {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.receiver__name {
    font-size: 1.2em;
}
.receiver__status {
    color: var(--secondary-color);
}
.receiver__app-name {
    font-weight: 600;
}

.receiver__cast-button,
.receiver__stop-button {
    align-self: center;
    justify-self: end;
    min-width: 80px;
}

.receiver__expand-button {
    background-image: url("../../assets/photon_arrowhead_down.svg");
}
.receiver__expand-button--expanded {
    background-image: url("../../assets/photon_arrowhead_up.svg");
}

.receiver__expanded {
    display: flex;
    width: 100%;
}

.media {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.media__metadata,
.media__controls {
    padding: 5px;
}

.media__metadata {
    display: flex;
    gap: 10px;
}

.media__image {
    align-self: start;
    border-radius: 4px;
    flex-grow: 0;
    max-height: 70px;
    max-width: 120px;
}

.media__metadata-text {
    display: flex;
    flex-direction: column;
}

.media__title {
    font-weight: 600;
}
.media__subtitle {
    color: var(--secondary-color);
}
.media__subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media__controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: auto;
}

.media__seek {
    align-items: center;
    display: flex;
    gap: 10px;
    min-height: 24px;
    width: 100%;
}
.media__seek-bar-container {
    display: flex;
    flex: 1;
    position: relative;
}
.media__seek-bar {
    flex: 1;
}
.media__seek-tooltip {
    --tooltip-color: var(--button-background);
    --tooltip-arrow-height: 5px;
    align-items: center;
    background-color: var(--tooltip-color);
    border-radius: 2px;
    display: flex;
    left: var(--seek-hover-position);
    padding: 2px 5px;
    padding-bottom: 3px;
    top: 0;
    pointer-events: none;
    position: absolute;
    transform: translate(
        -50%,
        calc(
            -50% - 1px - (var(--slider-track-height) / 2) - var(--tooltip-arrow-height)
        )
    );
    user-select: none;
}
.media__seek-tooltip::after {
    border: var(--tooltip-arrow-height) solid transparent;
    border-top-color: var(--tooltip-color);
    bottom: 0;
    content: "";
    left: 50%;
    position: absolute;
    transform: translate(-50%, 100%);
}

.media__current-time,
.media__remaining-time {
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.media__live {
    background: var(--box-color);
    border-radius: 4px;
    color: var(--box-background);
    font-size: 0.85em;
    font-weight: bold;
    grid-area: live;
    opacity: 0.75;
    padding: 2px 4px;
    text-transform: uppercase;
}

.media__buttons {
    align-items: center;
    display: flex;
    gap: inherit;
}

.media__buttons .ghost {
    min-height: 28px;
    min-width: 28px;
}

.media__play-button {
    background-image: url("../icons/play.svg");
}
.media__pause-button {
    background-image: url("../icons/pause.svg");
}

.media__previous-button {
    background-image: url("../icons/previous.svg");
}
.media__backward-button {
    background-image: url("../icons/backward.svg");
}
.media__forward-button {
    background-image: url("../icons/forward.svg");
}
.media__next-button {
    background-image: url("../icons/next.svg");
}

.media__cc-button {
    background-image: url("../icons/cc-on.svg");
    border: initial;
    font-size: 0;
}
.media__cc-button:hover {
    background-color: var(--button-background-hover);
}
.media__cc-button:active {
    background-color: var(--button-background-active);
}
.media__cc-button--off {
    background-image: url("../icons/cc-off.svg");
}
.media__cc-button > option {
    font-size: var(--font-size);
}
.media__cc-button > option {
    background-color: var(--box-background);
}

.media__mute-button {
    background-image: url("../icons/audio.svg");
}
.media__mute-button--muted {
    background-image: url("../icons/audio-muted.svg");
}

.media__volume {
    align-items: center;
    display: flex;
    gap: inherit;
    margin-inline-start: auto;
    min-width: 0;
}
.media__volume-slider {
    max-width: 100px;
    min-width: 0;
}

:root {
    --slider-track-height: 5px;
    --slider-thumb-size: 13px;
    --slider-fill-color: #00b6f0;
    --slider-track-color: rgba(0, 0, 0, 0.7);
    --slider-flare-color: rgba(255, 255, 255, 0.9);
}

.slider {
    background: initial;
    appearance: none;
    border: initial;
    margin: initial;
    outline: none;
    padding: initial;
    z-index: 1;
}

.slider:not(:focus-visible) {
    border-color: transparent;
}

.slider::-moz-range-progress,
.slider::-moz-range-track,
progress.slider {
    border-radius: calc(var(--slider-track-height) / 2);
    height: var(--slider-track-height);
}

/* <input type="range"> styling */
input[type="range"].slider {
    height: 24px;
}
.slider::-moz-range-track {
    background-color: var(--slider-track-color);
}
.slider::-moz-range-progress {
    background-color: var(--slider-fill-color);
}
.slider::-moz-range-thumb {
    background-color: currentColor;
    border: initial;
    border-radius: 50%;
    filter: drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.65));
    height: var(--slider-thumb-size);
    width: var(--slider-thumb-size);
}
.slider:hover::-moz-range-thumb {
    background-color: #48a0f7;
}
.slider:active::-moz-range-thumb {
    background-color: #2d89e6;
}

/* <progress> styling */
progress.slider {
    background-color: var(--slider-track-color);
    overflow: hidden;
}
.slider::-moz-progress-bar {
    appearance: none;
    background-color: var(--slider-fill-color);
    border-radius: inherit;
}

@keyframes indeterminate {
    from {
        background-position-x: 0%;
    }
    to {
        background-position-x: -100%;
    }
}
.slider:indeterminate::-moz-progress-bar,
.slider.slider--indeterminate::-moz-range-progress {
    animation: indeterminate 1.5s linear infinite;
    background-image: repeating-linear-gradient(
        to right,
        transparent 0%,
        var(--slider-flare-color) 25%,
        transparent 50%
    );
    background-size: 200% 100%;
}
